package com.dingreading.cloud.common.util.qyweixin;


import com.dingreading.cloud.common.util.DateUtil;
import com.dingreading.cloud.common.util.EnumType;

public class QyWeixinMsg {

    public static String confirmOrderMsg(String serverUrl, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/orderManage?keyword=" + code;
        return "**您有新的商城订单-待确认** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    // 实付金额为0的商城订单
    public static String confirmFreeOrderMsg(String serverUrl, String projectType, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/freeOrder?keyword=" + code;
        return "**您有新的商城订单-待确认** \n\n> **门店名称:** " + storeName + "\n**订单类型:** " + projectType + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    public static String bankApplyMsg(String serverUrl, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/orderManage?keyword=" + code;
        return "**您有新的商城订单-银行转账待确认** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    public static String bankCheckMsg(String serverUrl, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/orderConfirm?keyword=" + code;
        return "**您有新的商城订单-银行转账待审核** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    public static String bankPayMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/orderManage?keyword=" + code;
        return "**您有新的商城订单-银行转账已确认支付** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String goodsPayMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/orderManage?keyword=" + code;
        return "**商城订单-已支付** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    // 自营仓库
    public static String goodsWaitDeliveryMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/deliverOrder?keyword=" + code;
        return "**您有新的商城订单-待发货** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    // 第三方仓库
    public static String goodsThirdWaitDeliveryMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/thirdPartyDeliver?keyword=" + code;
        return "**您有新的商城订单-待发货（第三方仓库）** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String goodsOnlineWaitDeliveryMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/virtualOrder?keyword=" + code;
        return "**您有新的商城订单-待发货(虚拟商品)** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String goodsDeliveryMsg(
            String serverUrl, String storeName, String code, Integer projectType, String stockOutMethodType, String time,
            String menuUrl
    ) {
        String adminUrl = serverUrl + menuUrl + code;
        // 赠品叮叮地址
//        if (projectType.equals(EnumType.BalanceProject.GIFT_GOODS.getType())) {
//            adminUrl = serverUrl + "/admin/giftOrder?keyword=" + code;
//        }
        return "**商城订单-开始发货了** \n\n> **出库方式:** " + stockOutMethodType + "\n**门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String confirmOkOrderMsg(String serverUrl, String storeName, String code, Integer projectType, String time) {
        String orderType = "商城订单（自营门店）";
        String adminUrl = serverUrl + "/admin/orderManage?keyword=" + code;
        // 赠品订单地址
        if (projectType.equals(EnumType.BalanceProject.GIFT_GOODS.getType())) {
            orderType = "赠品订单";
            adminUrl = serverUrl + "/admin/giftOrder?keyword=" + code;
        }
        return "**" + orderType + "-审核通过** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String lessonIssue(String serverUrl, String uid, String storeName, String addStaffName, String levelName, String lessonName, String content, String time) {
        String adminUrl = serverUrl + "/admin/lessonIssue?uid=" + uid;
        return "<font color='warning'>活动系统建议和反馈</font> \n\n> **课次层级:** " + levelName + "\n**课次名称:** " + lessonName + "\n**门店名称:** " + storeName +
                "\n**员工姓名:** " + addStaffName + "\n**建议内容:** " + content + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String lessonIssueReply(String storeName, String addStaffName, String levelName, String lessonName, String content, String replyStaffName, String replyContent, String time) {
        return "<font color='info'>" + replyStaffName + "-已处理建议</font> \n\n> **课次层级:** " + levelName + "\n**课次名称:** " + lessonName + "\n**门店名称:** " + storeName +
                "\n**员工姓名:** " + addStaffName + "\n**建议内容:** " + content + "\n**处理内容:** " + replyContent + "\n**处理时间:** " + time;
    }

    public static String checkXyxServer() {
        return "小雨象服务器异常，请立即处理\n\n推送时间：" + DateUtil.getNowDatetimeStr();
    }

    public static String financeCheckFormMsg(String serverUrl, int menuType, String remark, String saleName, String storeName, String code, String time) {
        String adminUrl = menuType == 1 ? serverUrl + "/admin/orderManage?keyword=" + code : serverUrl + "/admin/purchaseFreeOrder?keyword=" + code;
        String status = "<font color='warning'>拒绝</font>" + "，" + remark;
        return "**财务审批-银行转账的商城订单** \n\n> **审批结果:** " + status + "\n**签单人:** " + saleName +
                "\n**门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

    public static String checkAliyunServer(String content) {
        return "**服务到期提醒** \n\n " + content;
    }

    public static String checkCmorderMsg(String serverUrl, String remark, String saleName, String storeName, String code, String time) {
        String somsUrl = serverUrl + "/soms/orderManage?keyword=" + code;
        String status = "<font color='warning'>拒绝</font>" + "，" + remark;
        return "**财务审批会员订单** \n\n> **审批结果:** " + status + "\n**门店名称:** " + storeName +
                "\n**订单编号:** " + code + "\n**签单人:** " + saleName + "\n**推送时间:** " + time + "\n[立即处理](" + somsUrl + ")";
    }

    // 采购或联营店
    public static String jointOperationConfirmFreeOrderMsg(String serverUrl, String projectType, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/purchaseFreeOrder?keyword=" + code;
        return "**您有新的商城订单-待确认** \n\n> **门店名称:** " + storeName + "\n**订单类型:** " + projectType + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    public static String jointOperationBankApplyMsg(String serverUrl, String storeName, String code) {
        String adminUrl = serverUrl + "/admin/purchaseFreeOrder?keyword=" + code;
        return "**您有新的商城订单-银行转账待确认** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + DateUtil.getNowDatetimeStr() + "\n[立即处理](" + adminUrl + ")";
    }

    public static String jointOperationGoodsPayMsg(String serverUrl, String storeName, String code, String time) {
        String adminUrl = serverUrl + "/admin/purchaseFreeOrder?keyword=" + code;
        return "**商城订单-已支付** \n\n> **门店名称:** " + storeName + "\n**订单编号:** " + code + "\n**推送时间:** " + time + "\n[立即处理](" + adminUrl + ")";
    }

}
